<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>v-text&v-html</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script type="text/javascript" src="../assets/js/vue.js"></script>
</head>

<body>
    <h1>v-text&v-html: 防止出现{{messa}} 这种情况</h1>
    <a href="../index.html">返回</a>
    <hr />
    <div id="app">
        <div>{{username}}</div><span v-text="message"></span>
        <hr/> v-html会解析内容中的html标签
        <br/>v-html会引起xss攻击

        <div>{{todo}}</div><span v-html="todo"></span>
    </div>

    <script>
        var app = new Vue({
            el: "#app",
            data: {
                isLogin: true,
                username: "zhangsan",
                message: "hello world",
                todo: "<h3>hello world</h3>"
            }
        })
    </script>
</body>

</html>